-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added 'inline' to content disposition check #3489
base: main
Are you sure you want to change the base?
Conversation
CC @MthwRobinson :) |
@scanny @cragwolfe - one of the tests is failing but unrelated to my change. I’ll leave it for you guys to fix? |
@TaylorN15 - Is there a test you could add for this? |
I checked and there is already a test EML file with inline and None for content disposition within the example docs that gets run during the test 😃 example-docs/eml/email-inline-content-disposition.eml |
Awesome! Would we have expected that test to fail prior to the fix? |
No, it would have passed except the inline content would not have been returned. I thought that was a bit strange that it was in the test file but not catered for in the code. ¯_(ツ)_/¯ |
In that case, could we add a test that asserts that the inline content is included now? |
It seems the test already has an assertion for content disposition of |
@TaylorN15 here's what we need: A test that fails before your change and passes afterward. If the current test can be modified to suit, that's fine. I can see the assertions there are pretty weak, maybe you can add something there. But what I would do is this:
Basic idea is:
|
@scanny I understand, I'm just not so great at writing tests :) |
@TaylorN15 why don't you post an anonymized version of the problematic message and I'll take a look. I expect I can whip up an appropriate test in a minute or two :) |
The original email I linked should suffice. I have just confirmed though that the issue is whether |
k, this test should be plenty: def test_partition_reads_message_part_with_inline_content_disposition():
elements = partition_email(
example_doc_path("eml/text-part-marked-inline.eml"), process_attachments=False
)
assert len(elements) == 1
e = elements[0]
assert e.text.startswith("Hi Please find attached a project proposal.")
assert e.text.endswith("Kind regards User ") Just name your original file You can add this test right after the one |
See discussion here. This adds
inline
to the allowed list of Content Disposition values when parsing EML files.